package com.hiv.client.model.weixin;

import com.hiv.client.model.base.Amount;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_1.shtml
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WeixinNativeCreateOrderReq implements Serializable {
  /** 应用ID：是 */
  private String appid;
  /** 直连商户号：是  */
  private String mchid;
  /** 商品描述：是 */
  private String description;
  /** 商户订单号：是 */
  private String out_trade_no;
//  /** 交易结束时间：否 */
//  private String time_expire;
  /** 附加数据: 否 */
  private String attach;
  /** 通知地址：是 */
  private String notify_url;
//  /** 订单优惠标记：否 */
//  private String goods_tag;
  /** 订单总金额，单位为分：是 */
  private Amount amount;
//  /** 优惠功能：否 */
//  private Object detail = null;
//  /** 场景信息：否 */
//  private SceneInfo scene_info;
//  /** 结算信息：否 */
//  private SettleInfo settle_info;

  public WeixinNativeCreateOrderReq(String weixinAppId, String mchId, String notifyUrl) {
    //this.appid = weixinAppId;
    //this.mchid = mchId;
    ////this.description = order.getSubjectName();
    //this.description = "宅狸家维修服务";
    //this.out_trade_no = order.getOrderNum();
    //this.attach = "";
    ////    this.time_expire = DateUtils.getDateWithTimeZone(DateUtils.addMinutes(new Date(), 30));
    //this.notify_url = notifyUrl;
    //BigDecimal money = new BigDecimal(order.getPayMoney() * 100);
    //this.amount = new Amount(money.intValue(), "CNY");
  }
}
